//导入定义验证规则的包

const joi = require('joi');

//定义用户名和密码的验证规则
const username = joi.string().alphanum().min(4).max(10).required()
const password = joi.string().pattern(/^[\S]{6,12}$/).required()
const phone = joi.string().regex(/^1[3456789]\d{9}$/).required()
//定义验证注册和登录表单数据规则的对象

exports.reg_login = {
    body:{
        phone,
        password
    }
}
exports.reg_form =  {
    body:{
        username,
        phone,
        password,
    }
}

